import router from '~/router'

const { set, get } = useCacheStore()

/**
 * 执行页面跳转
 * @param path 路由
 * @param params 参数
 */
export function go(path: string, params: any) {
  router.push({ path })
  set(path, params)
}

/**
 * 获取跳转参数
 */
export function getGoParam() {
  const path = useRouter().currentRoute.value.path
  console.log('getGoParam', path)
  console.log('getGoParam', get(path))
  return get(path)
}
